<?php

$current_page = get_smarty();

$friend_list = $Friends->get_list_for( $User->get_id() );

$friend_with = $Friends->is_users_friend( $User->get_id(), 2 );

$current_page->assign( 'friend_list', $friend_list );
$current_page->assign( 'friend_with', $friend_with );

switch( @$URL[1] )
{
	case '':
	default:
		
		break;
		
	case 'add':	
		$added = $Friends->add_friend_for( $User->get_id(), 2 );
		$current_page->assign( 'friend_added', $added );
		break;
	
	case 'delete':
		$deleted = $Friends->delete_friend_for( $User->get_id(), 2 );
		$current_page->assign( 'friend_deleted', $deleted );
		break;
}

$_page_content .= $current_page->fetch( 'friend_test.tpl' );

?>